Document new selection apis
authorMatthias Clasen <mclasen@redhat.com>
Mon, 23 Oct 2017 03:46:58 +0000 (05:46 +0200)
committerMatthias Clasen <mclasen@redhat.com>
Mon, 23 Oct 2017 03:58:54 +0000 (05:58 +0200)
Document the new cairo surface-based apis for GtkSelection.

docs/reference/gtk/gtk4-sections.txt
gtk/gtkselection.c

index f88b3bfcd8201d600803457e46b3ea60764d3702..38591fc66fab2850b5ff2a7485011954e1f1894f 100644 (file)
@@ -5247,6 +5247,8 @@ gtk_selection_data_set_text
 gtk_selection_data_get_text
 gtk_selection_data_set_pixbuf
 gtk_selection_data_get_pixbuf
+gtk_selection_data_set_surface
+gtk_selection_data_get_surface
 gtk_selection_data_set_uris
 gtk_selection_data_get_uris
 gtk_selection_data_get_targets
index 6590fac80e6d0def835c3c8c9b2d4285a5e874e0..611c09e677241ae3660ebdc6f9b84bc96e9530c1 100644 (file)
@@ -1733,6 +1733,20 @@ gtk_selection_data_set_pixbuf (GtkSelectionData *selection_data,
   return FALSE;
 }
 
+/**
+ * gtk_selection_data_set_surface:
+ * @selection_data: a #GtkSelectionData
+ * @surface: a cairo image surface
+ * 
+ * Sets the contents of the selection from a cairo image surface.
+ * The surface is converted to the form determined by
+ * @selection_data->target.
+ * 
+ * Returns: %TRUE if the selection was successfully set,
+ *   otherwise %FALSE.
+ *
+ * Since: 3.94
+ **/
 gboolean
 gtk_selection_data_set_surface (GtkSelectionData *selection_data,
                                cairo_surface_t  *surface)
@@ -1750,6 +1764,20 @@ gtk_selection_data_set_surface (GtkSelectionData *selection_data,
   return retval;
 }
 
+/**
+ * gtk_selection_data_get_surface:
+ * @selection_data: a #GtkSelectionData
+ * 
+ * Gets the contents of the selection data as a cairo surface.
+ * 
+ * Returns: (nullable) (transfer full): if the selection data
+ *   contained a recognized image type and it could be converted to a
+ *   cairo surface, a newly allocated surface is returned, otherwise
+ *   %NULL.  If the result is non-%NULL it must be freed with
+ *   g_object_unref().
+ *
+ * Since: 3.94
+ **/
 cairo_surface_t *
 gtk_selection_data_get_surface (GtkSelectionData *selection_data)
 {